<template>
  <div>
    <button @click="fetchFileContent">Fetch File Content</button>
  </div>
</template>

<script>
export default {
  created() {
    this.fetchFileContent();
  },
  methods: {
    async fetchFileContent() {
      try {
        const response = await fetch('./models/html.txt');
        const data = await response.text();
        console.log(data); // 打印文件内容到控制台
      } catch (error) {
        console.error('Error fetching file content:', error);
      }
    }
  }
}
</script>